package com.xss.contoller;

import com.xss.model.UserParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author DJ
 * @description
 **/
@RestController
@Slf4j
public class XssController {


    /**
     * @param param
     * @return java.lang.String
     * @author DJ
     **/
    @GetMapping("/test-get-xss")
    public String testXss(@RequestParam(value = "param", defaultValue = "") String param) {
        log.error("param=" + param);
        // ... todo 业务操作
        return param;
    }


    /**
     * @param userParam
     * @return com.xss.model.UserParam
     * @author DJ
     **/
    @PostMapping("/test-appliction-json-xss")
    public UserParam testJsonXss(@RequestBody UserParam userParam) {
        log.error(userParam.getId());
        log.error(userParam.getUserName());
        log.error(userParam.getPwd());
        // todo 写入一段病毒脚本
        // ... todo 业务操作
        return userParam;
    }
}
